<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<%
    response.setHeader("Pragma", "No-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);
    response.setContentType("text/html;charset=UTF-8");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>注 册</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#registbt").click(function () {
                alert("可以点击");
                $("#registForm").form('submit', {

                    url: "${pageContext.request.contextPath}/user/regist",
                    onSubmit: function () {

                        return true;
                    },
                    success: function (data) {
                        alert("返回成功" + data);
                        var daan = JSON.parse(data);
                        console.log(data);
                        console.log(data.msg);

                        if (daan.msg == 1) {
                            location.href = "${pageContext.request.contextPath}/login.jsp"
                        } else {

                            $("#messspan").html("<font>" + daan.msg + "</font>")
                        }
                    }

                });
            })
        })
    </script>
</head>
<body>
<div id="header" class="wrap">
    <img src="${pageContext.request.contextPath}/images/logo.gif"/>
</div>
<div id="navbar" class="wrap">
    <div class="search">
        <!--
            <form method="get" action="index.html">
                <input type="text" name="keywords" class="input-text" /><input type="submit" name="submit" class="input-button" value="" />
            </form>
        -->
    </div>
</div>
<div id="register" class="box">
    <h2>新用户注册</h2>
    <div class="content">
        <form id="registForm" method="post" action="${pageContext.request.contextPath}/user/regist">
            <dl>

                <dt>用户名：</dt>
                <dd><input type="text" class="input-text" name="vuUserName"
                           value="<%--<s:property value='userName'/>--%>"/></dd>
                <dt>密码：</dt>
                <dd><input type="password" class="input-text" name="vuPassword"
                           value="<%--<s:property value='password'/>--%>"/></dd>
                <dt>确认密码：</dt>
                <dd><input type="password" class="input-text" name="confirmPassword"
                           value="<%--<s:property value='confirmPassword'/>--%>"/></dd>
                <dt></dt>
                <dd><input id="registbt" type="button" class="input-button" value=""/></dd>
            </dl>
        </form>
        <div class="error"><%--<s:fielderror/>--%></div>
        <div class="error" id="messspan" style="color: red"><%--<s:actionerror/>--%></div>
    </div>
</div>
<div id="footer" class="wrap">
    百知 &copy; 版权所有
</div>
</body>
</html>
